package com.etc.service.impl;

import com.etc.dao.ScenicMapper;
import com.etc.entity.Scenic;
import com.etc.service.ScenicService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ScenicServiceImpl implements ScenicService {
    @Resource
    private ScenicMapper sm;
    /**
     * @Author 史泽浩
     * @Description 
     * @Date 2019/05/25 14:13
     * @Param [scenics]
     * @Return boolean
     **/
    @Override
    @Transactional
    public boolean insertScenic(List<Scenic> scenics) {
        int row = 0;
        for (Scenic scenic : scenics) {
            row = sm.insertScenic(scenic);
        }
        return row > 0;
    }

    @Override
    public List<Scenic> getScenicBySid(Integer sid) {
        return sm.getScenicBySid(sid);
    }
}
